<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>messager</title>
<link rel="stylesheet" type="text/css" href="css/easyui.css" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<link rel="stylesheet" type="text/css" href="css/SyntaxHighlighter.css" />

<script type="text/javascript" src="js/shCore.js"></script>
<script type="text/javascript" src="js/shBrushJScript.js"></script>
<script type="text/javascript" src="js/shBrushXml.js"></script>
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
</head>
<body style="text-align:left">
<div style="padding:10px">

<h3>Messager</h3>
<p>Override defaults with $.messager.defaults.</p>
<img src="images/messager.png">

<h4>Dependencies</h4>
<ul>
	<li>window</li>
	<li>linkbutton</li>
	<li>progressbar</li>
</ul>

<h4>Usage</h4>
<div class="dp-highlighter"><div class="bar"><div class="tools"></div></div><ol start="1" class="dp-c"><li class="alt"><span><span>$.messager.alert(</span><span class="string">'Warning'</span><span>,</span><span class="string">'The&nbsp;warning&nbsp;message'</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>$.messager.confirm(<span class="string">'Confirm'</span><span>,</span><span class="string">'Are&nbsp;you&nbsp;sure&nbsp;you&nbsp;want&nbsp;to&nbsp;delete&nbsp;record?'</span><span>,</span><span class="keyword">function</span><span>(r){&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(r){&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(<span class="string">'ok'</span><span>);&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>});&nbsp;&nbsp;</span></li></ol></div><textarea class="js" name="code-messager" style="display: none;">	$.messager.alert('Warning','The warning message');
	$.messager.confirm('Confirm','Are you sure you want to delete record?',function(r){
		if (r){
			alert('ok');
		}
	});
</textarea>

<h4>Properties</h4>
<table class="doc-table">
<tbody><tr>
<th><strong>Name</strong></th>
<th><strong>Type</strong></th>
<th><strong>Description</strong></th>
<th><strong>Default</strong></th>
</tr>
<tr>
<td>ok</td>
<td>string</td>

<td>The Ok button text.</td>
<td>Ok</td>
</tr>
<tr>
<td>cancel</td>
<td>string</td>
<td>The Cancel button text.</td>
<td>Cancel</td>
</tr>
</tbody></table>

<h4>Methods</h4>
<table class="doc-table">
<tbody><tr>
<th><strong>Name</strong></th>
<th><strong>Parameters</strong></th>
<th><strong>Description</strong></th>
</tr>
<tr>

<td>$.messager.show</td>
<td>options</td>
<td>Show a message window on right bottom of screen. The options parameter is a configuration object:<br>
showType: Defines how the message window to be showed. Available values are: null,slide,fade,show. Defaults to slide.<br>
showSpeed: Defines the time in milliseconds message window finishs show. Defaults to 600.<br>
width: Defines the width of message window. Defaults to 250.<br>
height: Defines the height of message window. Defaults to 100.<br>
msg: The message text to be showed.<br>
title: The title text to be showed on header panel.<br>

timeout: If defines to 0, the message window will not close unless user close it. Defines to unzero, the message window will be auto closed when timeout.</td>
</tr>
<tr>
<td>$.messager.alert</td>
<td>title, msg, icon, fn</td>
<td>Show an alert window. Parameters:<br>
title: The title text to be showed on header panel.<br>
msg: The message text to be showed.<br>
icon: The icon image to be showed. Available value are: error,question,info,warning.<br>
fn: The callback function triggered when window closed.</td>

</tr>
<tr>
<td>$.messager.confirm</td>
<td>title, msg, fn</td>
<td>Show a confirmation message window with Ok and Cancel buttons. Parameters:<br>
title: The title text to be showed on header panel.<br>
msg: The message text to be showed.<br>
fn(b): The callback function, when user click Ok button, pass a true value to function, otherwise pass a false to it.</td>
</tr>
<tr>
<td>$.messager.prompt</td>

<td>title, msg, fn</td>
<td>Show a message window with Ok and Cancel buttons prompting user to enter some text. Parameters:<br>
title: The title text to be showed on header panel.<br>
msg: The message text to be showed.<br>
fn(val): The callback function with a value parameter user entered.</td>
</tr>
<tr>
<td>$.messager.progress</td>
<td>options or method</td>
<td>
Show a progress message window. <br>
The options is defined as:<br>
title: The title text to be showed on header panel, default ''. <br>
msg: The message box body text, default ''. <br>
text: The text to display in the progress bar, default undefined. <br>
interval: The length of time in milliseconds between each progress update, default 300. <br>
<br>
The method is defined as:<br>
bar: Get the progressbar object. <br>
close: Close the progress window. <br>
<h5>Code Example</h5>
Show progress message window. <br>
<pre>	$.messager.progress(); 
</pre>
Now close the message window. <br>
<pre>	$.messager.progress('close');
</pre>

</td>
</tr>
</tbody></table>

</div>	
</body>
</html>